#include <iostream>
#include <iomanip>
using namespace std;
int main (void){
	int i,j,count=0;
	int p[1000];
	
	for (i=1;i<1000;i++){
		for(j=2;j<i;j++){
			if(i%j==0){
				break;
			}
		} 
		if(i==j){
			p[count]=i;
			count++;
		}
	}
	for (int m=0;m<count;m++){
		cout<<setw(5)<<p[m]<<"   ";
		if((m+1)%5!=0){
			continue;
		}
		cout<<endl;
	} 
	
	return 0;
}
